﻿using Brjnk.Common;
using Brjnk.GpxExplorer.Computing;
using Brjnk.GpxExplorer.Workspace.Searching;
using Brjnk.MVVM;

namespace Brjnk.GpxExplorer.ViewModel
{
    public class LocatedPhoto : DataItem, ISearchResults, IPoint
    {
        private Photo photo;
        private TrackVM locator;
        private FindTimeResult result;

        public LocatedPhoto(Photo photo, TrackVM locator, FindTimeResult result)
        {
            this.photo = photo;
            this.locator = locator;
            this.result = result;
        }

        public Photo Photo { get { return photo; } }

        public GpsCoordinates Position { get { return result.Position; } }

        public Distance? Elevation { get { return result.Elevation; } }

        public TrackVM Locator { get { return locator; } }

        public FindTimeResult Result { get { return result; } }

        public ObservableCollectionEx<SearchResult> SearchResults
        { get; set; }

        public GpsCoordinates PositionI
        {
            get
            {
                return Position;
            }
        }
    }
}